package com.xl98.service.impl;

import com.xl98.entity.RolePermission;
import com.xl98.mapper.RolePermissionMapper;
import com.xl98.service.RolePermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ls
 * @since 2020-05-15
 */
@Service
public class RolePermissionServiceImpl extends ServiceImpl<RolePermissionMapper, RolePermission> implements RolePermissionService {
@Autowired
private RolePermissionMapper rolePermissionMapper;
    @Override
    public List<RolePermission> selectRolePermissionByRoleId(String rid) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("role_id",rid);
        return rolePermissionMapper.selectByMap(map);
    }

    @Override
    public int addRolePerm(RolePermission rolePermission) {
        return rolePermissionMapper.insert(rolePermission);
    }
}
